// SETUP

#include intrographics.txt
#include ladyluckbiggraphics.txt

setdatapath("data/graphics/cutscenes/robot/");

var robotgraphics = {
	idle: {
		animation: "robot_idle.json",
		pack: "robot.pck",
		loop: true
	},
	worried_idle: {
		animation: "robot_worried_idle.json",
		pack: "robot.pck",
		loop: true
	}
}
var robot = addsprite("robot", 1, robotgraphics);

// HELPER FUNCTIONS	

var fade_time = 0.4;

// ACTORS
actor("Lady Luck", screenwidthmid + 800, 550, Col.YELLOW, CENTER, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
actor("Robot", 2600, 780, 0xDDDDDD, CENTER, BOTTOM, "chat_robot", "characters/robot/charicon_robot");

// INTRO

play("music_cutscene_dark");

robot.scale = 0.5;
robot.x = 2700 - ((robot.getwidth("idle") * robot.scale) / 2);
robot.y = 800;
changebackground("intro_stage");
fadein();
robot.show("idle");

ladyluck_big.x = -screenwidth;
ladyluck_big.show("idle");
Actuate.tween(ladyluck_big, 2, { x: 0 }).ease(Expo.easeOut);
play("cutscene_audience");

wait(0.5);

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Hey! How's the self-improvement going?");
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Are you the best possible version of yourself yet?");
speak("Lady Luck", "I only want top-quality minions in my dungeons.");
ladyluck_big.show("idle", true);

actor("Robot", 2600, 780, 0xDDDDDD, CENTER, BOTTOM, "chat_robot", "characters/robot/charicon_robot");
speak("Robot", "...not yet! But I’m gonna try harder.");
speak("Robot", "I’m still going to win.");

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Ah, bless your heart. Never give up hope.");
speak("Lady Luck", "Keep believing that this time, THIS|time, it might all be okay...");
ladyluck_big.show("idle", true);

speak("Robot", "It might!");
speak("Robot", "You know what? I think it|will be! I can feel it!");

ladyluck_big.show("talking-scary", true);
speak("Lady Luck", "Well, you’d better hope it happens soon - your time’s running |out, so quick, get in there and get fighting...");
ladyluck_big.show("idle-scary", true);

startgamefromcutscene();